home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / SERVICES.PAK / BORLANDC.H next >
Text File  |  1997-05-06  |  6KB  |  206 lines

  1. //----------------------------------------------------------------------------
  2. // Borland Services Library
  3. // Copyright (c) 1995, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   5.14  $
  6. //
  7. // Compiler-specific defines for Borland C/C++. Included only by compiler.h
  8. //----------------------------------------------------------------------------
  9. #if !defined(SERVICES_BORLANDC_H)
  10. #define SERVICES_BORLANDC_H
  11.  
  12. //----------------------------------------------------------------------------
  13. //  OS-specific flags defined here for DOS, Win16, Win32 & OS/2
  14. //----------------------------------------------------------------------------
  15.  
  16. //
  17. //  Define a platform flag.
  18. //
  19. //      BI_PLAT_MSW         Microsoft Windows, all versions including console
  20. //      BI_PLAT_OS2         IBM OS/2
  21. //      BI_PLAT_DOS         DOS
  22. //
  23. #if defined(_Windows) || defined(_WINDOWS) || defined(_WIN32)
  24. # define BI_PLAT_MSW
  25. #elif defined(__OS2__)
  26. # define BI_PLAT_OS2
  27. #else
  28. # define BI_PLAT_DOS
  29. #endif
  30.  
  31. //
  32. //  Specify the Windows API if we're compiling for Windows. Must
  33. //  define one of:
  34. //
  35. //      BI_PLAT_WIN16       Microsoft Windows 16
  36. //      BI_PLAT_WIN32       Microsoft Win32
  37. //
  38. #if defined(BI_PLAT_MSW)
  39. # if defined(_WIN32) || defined(__FLAT__)
  40. #   define BI_PLAT_WIN32
  41. # else
  42. #   define BI_PLAT_WIN16
  43. # endif
  44. #endif
  45.  
  46. //
  47. //  Define the memory model when compiling for Windows 16 or DOS. Must
  48. //  define one of:
  49. //
  50. //      BI_MODEL_TINY       DOS/Windows tiny model
  51. //      BI_MODEL_SMALL      DOS/Windows small model
  52. //      BI_MODEL_COMPACT    DOS/Windows compact model
  53. //      BI_MODEL_MEDIUM     DOS/Windows medium model
  54. //      BI_MODEL_LARGE      DOS/Windows large model
  55. //      BI_MODEL_HUGE       DOS/Windows huge model
  56. //
  57. #if defined( BI_PLAT_WIN16 ) || defined( BI_PLAT_DOS )
  58. # if defined( __TINY__ )
  59. #   define BI_MODEL_TINY
  60. # elif defined( __SMALL__ )
  61. #   define BI_MODEL_SMALL
  62. # elif defined( __COMPACT__ )
  63. #   define BI_MODEL_COMPACT
  64. # elif defined( __MEDIUM__ )
  65. #   define BI_MODEL_MEDIUM
  66. # elif defined( __LARGE__ )
  67. #   define BI_MODEL_LARGE
  68. # elif defined( __HUGE__ )
  69. #   define BI_MODEL_HUGE
  70. # endif
  71. #endif
  72.  
  73. //
  74. //  Define the pointer size. Must define one of:
  75. //
  76. //      BI_PTR_16_16        Intel 16:16 pointer
  77. //      BI_PTR_0_32         32-bit flat pointer (including Intel 0:32)
  78. //
  79. #if defined(__FLAT__) || defined(BI_PLAT_WIN32) || defined(BI_PLAT_OS2)
  80. # define BI_PTR_0_32
  81. #else
  82. # define BI_PTR_16_16
  83. #endif
  84.  
  85. //  Specify the size of data pointers and code
  86. //  pointers if applicable. Must define one of:
  87. //
  88. //      BI_DATA_NEAR        16-bit pointer in 16:16 models
  89. //      BI_DATA_FAR         32-bit pointer in 16:16 models
  90. //      BI_DATA_HUGE        32-bit huge pointer in 16:16 models
  91. //
  92. //  Must also define one of:
  93. //
  94. //      BI_CODE_NEAR        16-bit pointer in 16:16 models
  95. //      BI_CODE_FAR         32-bit pointer in 16:16 models
  96. //
  97. #if defined(BI_PTR_16_16)
  98. # if defined(BI_MODEL_TINY) || defined(BI_MODEL_SMALL) || defined(BI_MODEL_MEDIUM)
  99. #   define BI_DATA_NEAR
  100. # elif defined(BI_MODEL_COMPACT) || defined(BI_MODEL_LARGE)
  101. #   define BI_DATA_FAR
  102. # else
  103. #   define BI_DATA_HUGE
  104. # endif
  105. # if defined(BI_MODEL_TINY) || defined(BI_MODEL_SMALL) || defined(BI_MODEL_COMPACT)
  106. #   define BI_CODE_NEAR
  107. # else
  108. #   define BI_CODE_FAR
  109. # endif
  110. #endif
  111.  
  112. //
  113. //  Define the type of application being built. Must be one of:
  114. //
  115. //      BI_APP_EXECUTABLE
  116. //      BI_APP_DLL
  117. //
  118. #if defined(__DLL__) || defined(_DLL)
  119. # define BI_APP_DLL
  120. #else
  121. # define BI_APP_EXECUTABLE
  122. #endif
  123.  
  124. //
  125. //  Only enable multi-thread classes when the OS supports them, and/or when the
  126. //  runtime library support them
  127. //
  128. #if defined(BI_PLAT_WIN32) || defined(BI_PLAT_OS2)
  129. # define BI_MULTI_THREAD
  130. #endif
  131. #if defined(__MT__)
  132. # define BI_MULTI_THREAD_RTL
  133. #endif
  134.  
  135. //----------------------------------------------------------------------------
  136. //  Compiler-specific flags.
  137. //----------------------------------------------------------------------------
  138.  
  139. //
  140. // Specific name of compiler, BI_COMP_xxxx
  141. //
  142. #define BI_COMP_BORLANDC
  143.  
  144. //
  145. //  C++ language features
  146. //
  147. //  When compiling with a compiler that doesn't support these
  148. //  features directly, remove the // from the appropriate
  149. //  #define below or define the macro in the build environment.
  150. //
  151.  
  152. // BC v5.0 introduces the ability to import/export templates
  153. //
  154. #if (__BORLANDC__ >= 0x500)
  155. # define BI_IMPEXP_TEMPLATES // Import and export template instances
  156. #endif
  157.  
  158. // BC has had these since 4.0
  159. //
  160. #if (__BORLANDC__ < 0x400)
  161. # define BI_NO_ARRAYNEW      // operators new[] & delete[]   -
  162. # define BI_NO_COVAR_RET     // Covariant returns in overrides -
  163. # define BI_NO_RTTI          // RTTI and __rtti keyword      DEFS.H
  164. # define BI_NO_THROWSPEC     // Function throw specifiers    EXCEPT.H
  165. # define BI_NO_LVAL_CASTS    // Can cast lvalues
  166. #endif
  167.  
  168. // These were not available previous to BC 5.0
  169. //
  170. #if (__BORLANDC__ < 0x500)
  171. # define BI_NO_BOOL          // Standard bool type           DEFS.H
  172. # define BI_NO_MUTABLE       // Mutable keyword              DEFS.H
  173. # define BI_NO_NAMESPACE     // Namespaces
  174. #endif
  175.  
  176. #if (__BORLANDC__ < 0x400)
  177. # define BI_NO_NEW_CASTS     // New style casts              CASTABLE.H
  178. #endif
  179.  
  180. //
  181. // Hand define macros for BC 4.x to be compatible with win SDK headers
  182. //
  183. #if (__BORLANDC__ < 0x500)
  184. # if !defined(_WCHAR_T_DEFINED)
  185. #   define _WCHAR_T_DEFINED  // done already in win32/windows.h ?
  186. # endif
  187. # if defined(BI_PLAT_WIN32) && !defined(_WIN32)
  188. #   define _WIN32
  189. # endif
  190. #endif
  191.  
  192. //
  193. //  To use Borland's register calling conventions in the class library,
  194. //  remove the // from the #define below and rebuild the libraries
  195. //  with the -po command line switch.
  196. //  Note: -po is only available for Borland's 16-bit optimizing compiler.
  197. //
  198. //#define _CLASSLIB_ALLOW_po  // use register calling convention
  199. //                            // (must also use -po on command line)
  200.  
  201. #if defined(__BCOPT__) && !defined(__FLAT__) && !defined(_CLASSLIB_ALLOW_po)
  202. # define BI_CLASSLIB_NO_po
  203. #endif
  204.  
  205. #endif  // SERVICES_BORLANDC_H
  206.